﻿using System;
using RestSharp;

namespace WJ.Infrastructure.WeChat
{
    public class Http
    {
        static RestClient client = new RestClient("https://api.mch.weixin.qq.com/");

        public static string Post(string resource, string xml)
        {
            var request = new RestRequest(resource, Method.POST);

            request.AddParameter("application/xml", xml, ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);

            return response.Content;
        }
    }
}